package com.emily.test.service.impl;

import com.emily.test.mapper.OContactMapper;
import com.emily.test.model.OContact;
import com.emily.test.service.OContactService;
import com.emily.test.utils.ConstentUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service("oContactServiceAgent")
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT,timeout=36000,rollbackFor=Exception.class)
public class OContactServiceImpl implements OContactService {
    @Resource
    private OContactMapper oContactMapper;


    @Override
    public List<OContact> selectContactListByCondition(OContact oContact) {
        return oContactMapper.selectContactListByCondition(oContact);
    }

    @Override
    public int insertContact(OContact oContact) {
        return oContactMapper.insertSelective(oContact);
    }

    @Override
    public int updateContact(OContact oContact) {
        return oContactMapper.updateContact(oContact);
    }

    @Override
    public int deleteContactByIds(List<OContact> oContactList) {
        return oContactMapper.deleteContactByIds(oContactList);
    }
}
